第 10 步:我们几乎完成了这个功能!让我们使用用户的输入来改变星星。

  • ,拖动在get_user_input()中缩进的Return Statement
  • 为了使我们的程序更简单,我们将用户的输入作为列表返回。 my_var更改为[ number , color ]
  • 最后,在main()中,找到这一行: create_stars( 100 , · "yellow" )
  • 100更改为user_input [ 0 ]并将"yellow"更改为user_input [ 1 ] 。点击跑去看看会发生什么!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)